local t = Def.ActorFrame{};

t[#t+1] = Def.ActorFrame {
	LoadActor("_chipwoosh")..{
		InitCommand=function(self) self:Center():FullScreen() end;
		OnCommand=function(self) self:queuecommand("Play") end;
		PlayCommand=function(self) self:play() end;
	};
	LoadActor("_chipvisualtitle") .. {
		InitCommand=function(self) self:Center():FullScreen():diffusealpha(0) end;
		OnCommand=function(self) self:sleep(0.45):diffusealpha(1):queuecommand("Play") end;
		PlayCommand=function(self) self:play() end;
	};
	LoadActor("_titlewoosh")..{
		InitCommand=function(self) self:queuecommand("Play") end;
		PlayCommand=function(self) self:play() end;
	};
	LoadActor(THEME:GetPathS("", "_title theme"))..{
		InitCommand=function(self) self:sleep(0.45):queuecommand("Play") end;
		PlayCommand=function(self) self:play() end;
		OffCommand=function(self) self:pause(true) end;
	};
	Def.ActorFrame {
		InitCommand=function(self) self:addy(360):skewx(0.25):skewy(0.3):rotationx(180) end;
		OnCommand=function(self) self:sleep(0.2):linear(0.3):addx(900) end;
		LoadActor("_chipcircle") .. {
			InitCommand=function(self) self:Center():addx(-815) end;
			OnCommand=function(self) self:sleep(0.55):queuecommand("Animate") end;
			OffCommand=function(self) self:stoptweening():diffusealpha(0) end;
			AnimateCommand=function(self) self:sleep(0.345):linear(0.1):addrotationz(-15):queuecommand("Animate") end;
		};	
		LoadActor("_chipcircle") .. {
			InitCommand=function(self) self:Center():addx(-815):diffusealpha(0) end;
			OffCommand=function(self)
				self:diffusealpha(1):sleep(0.75):accelerate(0.8):addrotationz(540):linear(0.2):addrotationz(540):addx(-900):addy(300)
			end;
		};	
	};
	LoadActor("_chiptext") .. {
		InitCommand=function(self) self:Center():addx(815) end;
		OnCommand=function(self) self:sleep(0.2):linear(0.3):addx(-850) end;
		OffCommand=function(self) self:sleep(1.55):linear(0.2):addx(850) end;
	};	
	LoadActor("_rev") .. {
		OffCommand=function(self) self:sleep(0.65):queuecommand("Play") end;
		PlayCommand=function(self) self:play() end;
	};
	LoadActor("_dash") .. {
		OffCommand=function(self) self:sleep(1.65):queuecommand("Play") end;
		PlayCommand=function(self) self:play() end;
	};
	
};
-- Version info on top corner

t[#t+1] = Def.ActorFrame {
	OnCommand=cmd(diffusealpha,0;smooth,0.4;diffusealpha,1;);
	OffCommand=cmd(smooth,0.4;diffusealpha,0;);
		Def.BitmapText { 
			Font= "Common Normal",
			Text= "Songs:",
			InitCommand= function(self) self:shadowlength(1):zoom(0.6):xy(16,24):diffuse(color("#FFFFFF")):horizalign(left) end
		};
		Def.BitmapText { 
			Font= "_squarehead",
			Text= tostring(SONGMAN:GetNumSongs()), 
			InitCommand= function(self) self:shadowlength(1):zoom(0.6):xy(66,25):diffuse(color("#FFFFFF")):horizalign(left) end
		};
	};
	
t[#t+1] = Def.ActorFrame {
	OnCommand=cmd(diffusealpha,0;smooth,0.4;diffusealpha,1;);
	OffCommand=cmd(smooth,0.4;diffusealpha,0;);
		Def.BitmapText { 
			Font= "Common Normal",
			Text= "Courses:",
			InitCommand= function(self) self:shadowlength(1):zoom(0.6):xy(16,44):diffuse(color("#FFFFFF")):horizalign(left) end
		};
		Def.BitmapText { 
			Font= "_squarehead",
			Text= tostring(SONGMAN:GetNumCourses()), 
			InitCommand= function(self) self:shadowlength(1):zoom(0.6):xy(84,45):diffuse(color("#FFFFFF")):horizalign(left) end
		};
	};	
	
t[#t+1] = Def.ActorFrame {
	InitCommand=cmd(x,SCREEN_RIGHT-16);
	OnCommand=cmd(diffusealpha,0;smooth,0.4;diffusealpha,1;);
	OffCommand=cmd(smooth,0.4;diffusealpha,0;);
		Def.BitmapText { 
			Font= "_squarehead",
			Text= string.format("StepMania %s", ProductVersion()), 
			InitCommand= function(self) self:shadowlength(1):zoom(0.75):y(24):diffuse(color("#FFFFFF")):horizalign(right) end
		};
	};
	
t[#t+1] = Def.ActorFrame {
	InitCommand=cmd(y,SCREEN_BOTTOM-16);
	OnCommand=cmd(diffusealpha,0;smooth,0.4;diffusealpha,1;);
	OffCommand=cmd(smooth,0.4;diffusealpha,0;);
		Def.BitmapText { 
			Font= "_squarehead",
			Text= "BETA Indef. LIVE-DEV 3-14-23",
			InitCommand= function(self) self:shadowlength(1):zoom(0.6):x(_screen.cx):diffuse(color("#FFFFFF")) end
		};
	};	


local coinMode = GAMESTATE:GetCoinMode()
t[#t+1] = Def.ActorFrame {
	Condition=coinMode ~= "CoinMode_Home";
	InitCommand=function(self) self:y(SCREEN_BOTTOM-60):diffusealpha(0) end;
	OnCommand=function(self) self:sleep(1):queuecommand("Blink") end;
	BlinkCommand=function(self) self:diffusealpha(1):sleep(0.25):diffusealpha(0):sleep(0.25):queuecommand("Blink") end;
	OffCommand=function(self) self:playcommand("Flicker") end;
	FlickerCommand=function(self) self:finishtweening():diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):linear(0.1):zoomy(0) end;
		LoadFont("_coaster")..{ 
			OnCommand=function(self) self:shadowlength(1):zoom(1.5):x(_screen.cx):diffuse(color("#FFFFFF")):playcommand("Set") end;
			CoinInsertedMessageCommand=function(self) self:playcommand("Set") end;
			SetCommand=function(self)
				local coinsNeed = GAMESTATE:GetCoinsNeededToJoin()
				local coinsIn = GAMESTATE:GetCoins()
				local coinsOK = GAMESTATE:EnoughCreditsToJoin()
				if coinsOK then
					self:settext("PRESS START");
				elseif not coinsOK then
					self:settext("INSERT COINS: "..coinsIn.." OF "..coinsNeed);
				end
			end;
		};
	};	
return t